package main

import (
	"log"
	"net"
)

func main() {
	listen, err := net.Listen("tcp", ":8081")
	if err != nil {
		log.Fatal(err)
	}
	defer listen.Close()
	accept, err := listen.Accept()
	if err != nil {
		log.Fatal(err)
	}
	defer accept.Close()
	for {
		buf := make([]byte, 1)
		n, err := accept.Read(buf)
		if err != nil {
			log.Fatal(err)
		}
		if n == 0 {
			break
		}
		res :=`HTTP/1.1 200\r\n"
               Content-Length: 11\r\n\r\n"
               Hello World"`
		accept.Write([]byte(res))
	}
}
